<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>管理举报信息</title>
</head>
<body>
<div id="report">
<table border="1" cellspacing="0">
    <thead>
    <tr align="center" height="40">
        <th width="1000">内容</th>
        <th width="50">博客id</th>
        <th width="90">举报时间</th>
    </tr>
    </thead>
    <tr v-for="report in reports" aligen="center" height="40">
        <td>{{report.context}}</td>
        <td>{{report.blogId}}</td>
        <td>{{report.date}}</td>
        <td>
            <form action="./show_report.html" method="get">
                <input style="display: none" type="text" name="reportId" :value="report.id">
                <input type="submit" value="查看" >
            </form>
        </td>
    </tr>
</table>
</div>
</body>
</body>
</html>

<script src="../js/ajax.js"></script>
<script src="../js/vue.js"></script>

<script>

    window.onload=function getData(){

        new Vue({
            el:"#report",
            data(){
                return{
                    reports:[]
                }
            },
            mounted(){
                let _this=this;
                ajax({
                    method: "post",
                    url: "../../report",
                    data: {
                        code:1
                    },
                    success: function (result) {
                        console.log(result);
                        _this.reports=result;
                    },
                    error:function (result){
                        console.log(result);
                    }
                })
            }
        })
    }
</script>